package com.juyu.miliao.api.dao.mysql;

import com.juyu.miliao.api.domain.OfficialQuestionInfo;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * 官方问题信息Dao
 *
 * @author xuanqicheng
 * @create 2018-18-10:30 AM
 */
@Repository
public class OfficialQuestionInfoDao {

    @Autowired
    private SqlSession sqlSession;
    /**
     * 获取一个最新的官方问题
     */
    public OfficialQuestionInfo getOneQuestionInfo() {

        return sqlSession.selectOne("getOneQuestionInfo");

    }

    public List<OfficialQuestionInfo> selectPage(Map<String, Object> parameterMap) {
        return sqlSession.selectList("selectPage",parameterMap);
    }

    public OfficialQuestionInfo selectOneById(Integer id) {
        return sqlSession.selectOne("selectOneById",id);
    }
}
